import { Entity, PrimaryColumn, Column } from 'typeorm';

@Entity('student')
export class Student {
    @PrimaryColumn({ 
      name: 'sno', 
      type: 'char', 
      length: 5,
      insert: false  // 禁止TypeORM插入该字段
    })
    sno: string;

    @Column({ name: 'sname', type: 'varchar', length: 50 })
    sname: string;

    @Column({ name: 'age', type: 'int' })
    age: number;

    @Column({ name: 'sex', type: 'char', length: 1 })
    sex: string;

    @Column({ name: 'sdept', type: 'varchar', length: 50 })
    sdept: string;
}